package cn.swu.lzr.JDBC;

import cn.swu.lzr.event.Event;
import com.mysql.cj.jdbc.Driver;


import java.sql.*;

import java.util.List;


public class JDBC {
    private static final String DELETE_BY_ID = "DELETE FROM event WHERE id = ?";
    public static  void  main(String[] args) throws Exception {


            DBTools dbTools = new DBTools();




            List<Event> eventList = dbTools.FindALL();
            System.out.println("全部结果:");
            for(Event event: eventList)
            {
                System.out.println(event);
            }


        System.out.println("-----------------------------------------------");
        List<Event> eventLists = dbTools.FindALL();
        System.out.println("全部结果:");
        for(Event event2: eventList)
        {
            System.out.println(event2);
        }

        Integer rows = dbTools.getCount();
        System.out.println(rows);

        List<Event> eventLists2 = dbTools.Find_Page(1);
        System.out.println("-----------------------------------------------");

        System.out.println("5个结果:");
        for(Event event2: eventLists2)
        {
            System.out.println(event2);
        }



    }
}
